import XtxMessageCom from './index.vue'
import Vue from 'vue'

export default function XtxMessage(obj) {
  const Xtxfn = Vue.extend(XtxMessageCom)
  const xtxObj = new Xtxfn()
  xtxObj.type = obj.type
  xtxObj.text = obj.text

  xtxObj.$mount()
  document.body.append(xtxObj.$el)
  console.log(xtxObj.$el)
}

XtxMessage.error = function(txt) {
  const XtxFn = Vue.extend(XtxMessageCom)
  const xtxObj = new XtxFn()
  xtxObj.type = 'error'
  xtxObj.text = txt

  xtxObj.$mount()
  document.body.append(xtxObj.$el)
  console.log(xtxObj.$el, '111')
}
